package com.cobra.consumer;

import com.cobra.framework.Invocation;
import com.cobra.framework.ProxyFactory;
import com.cobra.framework.protocol.http.HttpClient;
import com.cobra.provider.api.HelloService;

public class Consumer {
    public static void main(String[] args) {

        for (int i = 0; i < 10; i++) {
            HelloService helloService = ProxyFactory.getProxy(HelloService.class);
            String result = helloService.sayHello("Tom");
            System.out.println(result);
            System.out.println("==================================");
        }
//        HttpClient httpClient = new HttpClient();
//        Invocation invocation = new Invocation(
//                HelloService.class.getName(),"sayHello",new Class[]{String.class}
//                ,new Object[]{"Tom"}
//        );
//        String result = httpClient.send("localhost", 8080, invocation);
//        System.out.println(result);
    }
}
